isOdd.ts
thoward37@gmail.com/shirt[create-new-file-named-truncate-js] / isOdd.ts
@ cfd6a75d
Download
Ladder Summary
This file defines and exports a function `isOdd` that takes a numeric argument and returns a boolean indicating whether the given number is odd (i.e., not evenly divisible by 2).
+/**
+ * Determines if a number is odd.
+ *
+ * @param n - The number to check.
+ * @returns true if n is odd, false otherwise.
+ */
+export function isOdd(n: number): boolean {
+ return n % 2 !== 0;
+}